
import request from '@/utils/request';

export function permissionMenu(query) {
  return request({
    url: `/admin/list${query}`,
    method: 'get',
  });
}

export function getMenu(query) {
  return request({
    url: '/menu/cachedata',
    method: 'get',
  });
}

export function saveMenu(form) {
  return request({
    url: '/admin/add',
    method: 'post',
    data: form
  });
}

export function updateMenu(form) {
  return request({
    url: '/admin/edit',
    method: 'post',
    data: form
  });
}
export function cacheMenu() {
  return request({
    url: '/permissions/cache',
    method: 'get',
  })
}
export function sociatyList() {
  return request({
    url: '/role/sociaty/list',
    method: 'get',
  })
}


export function deleteSysUser(id) {
  return request({
    url: '/api/auth/auth/getDeleted?id=' + id,
    method: 'get'
  });
}

export function getSysUserById(id) {
  return request({
    url: '/api/system/user/getById',
    method: 'post',
    data: {'id': id}
  });
}

export function explanationList() {
  return request({
    url: '/api/system/explanation/findType',
    method: 'get',
  })
}

export function getReason(id) {
  return request({
    url: '/api/system/reason/listPage',
    method: 'post',
    data: { 'typesId': id }
  })
}

export function getSelectAll(id) {
  return request({
    url: '/api/system/type/selectAll',
    method: 'post',
    data: {}
  })
}

export function deleteMenu() {
  return Promise.reject(new Error('接口不可用'))
}
